
import axios from 'axios';

/**
 * 店铺
 */
export class ShopService {
    // 分页查询列表
    static findShops (queryParams) {
        return axios({
            url: '/mall/merchant/Shop/findShops',
            method: 'POST',
            data: queryParams
        });
    }

    //根据ID查询指定的店铺
    static findShop (shopId) {
        const query = {
            shopId
        }
        return axios({
            url: '/mall/merchant/Shop/findShop',
            method: 'POST',
            params: query,
        });
    }

    //根据ID查询指定的店铺(包含外键名称)
    static findShopForView (shopId) {
        const query = {
            shopId
        }
        return axios({
            url: '/mall/merchant/Shop/findShopForView',
            method: 'POST',
            params: query,
        });
    }

    //根据ID查询指定的店铺(包含外键名称)
    static findShopForEdit (shopId) {
        const query = {
            shopId
        }
        return axios({
            url: '/mall/merchant/Shop/findShopForEdit',
            method: 'POST',
            params: query,
        });
    }

    //根据ID查询指定的店铺(只提取ID 和 Name)
    static findShopsWithIdNameById (shopId) {
        const query = {
            shopId
        }
        return axios({
            url: '/mall/merchant/Shop/findShopsWithIdNameById',
            method: 'POST',
            params: query,
        });
    }

    //根据名称查询店铺集合(只提取ID 和 Name)
    static findShopsWithIdNameByName (shopName) {
        const query = {
            shopName
        }
        return axios({
            url: '/mall/merchant/Shop/findShopsWithIdNameByName',
            method: 'POST',
            params: query,
        });
    }

    //新增保存店铺
    static saveShop (shop) {
        const query = {}
        return axios({
            url: '/mall/merchant/Shop/saveShop',
            method: 'POST',
            params: query,
            data: shop
        });
    }

    //修改保存店铺
    static updateShop (shop) {
        const query = {}
        return axios({
            url: '/mall/merchant/Shop/updateShop',
            method: 'POST',
            params: query,
            data: shop
        });
    }

    //根据ID查询指定的店铺(只提取ID 和 Name)
    static deleteShop (shopId) {
        const query = {
            shopId
        }
        return axios({
            url: '/mall/merchant/Shop/deleteShop',
            method: 'POST',
            params: query,
        });
    }
}
